﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

namespace FtpRemoting
{
    /// <summary>
    /// FtpRemoting 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://www.tiyma.com/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class Service1 : System.Web.Services.WebService
    {

        /// <summary>
        /// 获取登陆FTP的链接信息 信息之间用 $ 分割
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public string GetFTPConnectionInfo()
        {
              string t_ftp_server = "61.150.91.98";
              string t_ftp_port = "2021";
              string t_user_name = "medal";
              string t_password = "2004111091";

              return string.Format("{0}${1}${2}${3}", t_ftp_server, t_ftp_port, t_user_name, t_password);
        }

        /// <summary>
        /// 用户登陆，登陆成功 返回用户的 user_id，长整型 该数字作为该用户上传文件的目录，登陆失败返回-1
        /// </summary>
        /// <param name="i_user_name"></param>
        /// <param name="i_password"></param>
        /// <returns></returns>
        [WebMethod]
        public long LoginUser(string i_user_name, string i_password)
        {
            return 100;
        }

        /// <summary>
        /// 用户上传数据成功后把上传数据信息添加到数据表
        /// </summary>
        /// <param name="i_user_id"></param>
        /// <param name="i_file_name"></param>
        /// <param name="i_upload_time"></param>
        [WebMethod]
        public void InsertUserUploadData(long i_user_id, string i_file_name, DateTime i_upload_time)
        {
        }
    }
}
